#ifndef CALLBACKS_H
#define CALLBACKS_H

#include <functional>
#include <memory>

class TcpConnection;
class Buffer;

typedef std::shared_ptr<TcpConnection> TcpConnectionPtr;

typedef std::function<void(TcpConnectionPtr conn)> ConnectionCallback;

typedef std::function<void(TcpConnectionPtr conn, 
                            Buffer& buffer)> MessageCallback;

typedef std::function<void(TcpConnectionPtr conn)> CloseCallback;

// 用户数据发送完毕时回调
typedef std::function<void(TcpConnectionPtr conn)> WriteCompleteCallback;

// 发送缓冲区中数据多于一定程度时回调
typedef std::function<void(TcpConnectionPtr conn, size_t len)> HighWaterMarkCallback;

// 定时器回调函数
typedef std::function<void()> TimerCallback;

#endif